﻿using System.Web.Mvc;
using Odyssey.Linq;
using Odyssey.Web.Models;
using SunTzu.Web;

namespace Odyssey.Web.Controllers
{
    public class BulletinController : FrontBaseController
    {
        public ActionResult Register()
        {
            BindTopNavigation();

            return View();
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Register(BulletinModel bulletinModel)
        {
            if (ModelState.IsValid)
            {
                tb_bulletin bulletin = new tb_bulletin();
                HTMLHelper.BindModel(bulletin);
                bulletin.SaveOrUpdate();
                return Redirect("/");
            }
            BindTopNavigation();
            return View(bulletinModel);
        }
    }
}
